home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / STBA2.ZIP / MAIN.FRM < prev    next >
Text File  |  1993-03-16  |  7KB  |  232 lines

  1. VERSION 2.00
  2. Begin MDIForm fmMain 
  3.    Caption         =   "Stbar Example Main Form"
  4.    Height          =   4935
  5.    Left            =   1755
  6.    LinkTopic       =   "MDIForm1"
  7.    Top             =   1755
  8.    Width           =   7485
  9.    Begin PictureBox piStBar 
  10.       Align           =   2  'Align Bottom
  11.       BorderStyle     =   0  'None
  12.       Height          =   615
  13.       Left            =   0
  14.       ScaleHeight     =   615
  15.       ScaleWidth      =   7365
  16.       TabIndex        =   0
  17.       Top             =   3630
  18.       Width           =   7365
  19.       Begin StBar sbEnd 
  20.          Prop21          =   -1
  21.          Prop22          =   6
  22.          BackColor       =   &H00C0C0C0&
  23.          DrawMode        =   1  'Flat
  24.          FontBold        =   0   'False
  25.          FontItalic      =   0   'False
  26.          FontName        =   "MS Sans Serif"
  27.          FontSize        =   8.25
  28.          FontStrikethru  =   0   'False
  29.          FontUnderline   =   0   'False
  30.          Height          =   345
  31.          Indicator       =   0  'None
  32.          Left            =   7650
  33.          Top             =   270
  34.          Width           =   855
  35.       End
  36.       Begin StBar sbEdit 
  37.          Prop21          =   -1
  38.          Prop22          =   5
  39.          BackColor       =   &H00C0C0C0&
  40.          Caption         =   "EINF"
  41.          DrawMode        =   0  'Down
  42.          FontBold        =   0   'False
  43.          FontItalic      =   0   'False
  44.          FontName        =   "MS Sans Serif"
  45.          FontSize        =   8.25
  46.          FontStrikethru  =   0   'False
  47.          FontUnderline   =   0   'False
  48.          Height          =   345
  49.          Indicator       =   4  'EditMode
  50.          Left            =   7020
  51.          Top             =   270
  52.          Width           =   630
  53.       End
  54.       Begin StBar sbScroll 
  55.          Prop21          =   -1
  56.          Prop22          =   4
  57.          BackColor       =   &H00C0C0C0&
  58.          DrawMode        =   0  'Down
  59.          FontBold        =   0   'False
  60.          FontItalic      =   0   'False
  61.          FontName        =   "MS Sans Serif"
  62.          FontSize        =   8.25
  63.          FontStrikethru  =   0   'False
  64.          FontUnderline   =   0   'False
  65.          Height          =   345
  66.          Indicator       =   3  'Scroll
  67.          Left            =   6390
  68.          Top             =   270
  69.          Width           =   630
  70.       End
  71.       Begin StBar sbCaps 
  72.          Prop21          =   -1
  73.          Prop22          =   3
  74.          BackColor       =   &H00C0C0C0&
  75.          DrawMode        =   0  'Down
  76.          FontBold        =   0   'False
  77.          FontItalic      =   0   'False
  78.          FontName        =   "MS Sans Serif"
  79.          FontSize        =   8.25
  80.          FontStrikethru  =   0   'False
  81.          FontUnderline   =   0   'False
  82.          Height          =   345
  83.          Indicator       =   2  'Caps
  84.          Left            =   5760
  85.          Top             =   270
  86.          Width           =   630
  87.       End
  88.       Begin StBar sbNum 
  89.          Prop21          =   -1
  90.          Prop22          =   2
  91.          BackColor       =   &H00C0C0C0&
  92.          DrawMode        =   0  'Down
  93.          FontBold        =   0   'False
  94.          FontItalic      =   0   'False
  95.          FontName        =   "MS Sans Serif"
  96.          FontSize        =   8.25
  97.          FontStrikethru  =   0   'False
  98.          FontUnderline   =   0   'False
  99.          Height          =   345
  100.          Indicator       =   1  'Num
  101.          Left            =   5130
  102.          Top             =   270
  103.          Width           =   630
  104.       End
  105.       Begin StBar sbMain 
  106.          Prop21          =   -1
  107.          Prop22          =   1
  108.          BackColor       =   &H00C0C0C0&
  109.          DrawMode        =   0  'Down
  110.          FontBold        =   0   'False
  111.          FontItalic      =   0   'False
  112.          FontName        =   "MS Sans Serif"
  113.          FontSize        =   8.25
  114.          FontStrikethru  =   0   'False
  115.          FontUnderline   =   0   'False
  116.          Height          =   345
  117.          Indicator       =   0  'None
  118.          Left            =   0
  119.          Top             =   270
  120.          Width           =   5130
  121.       End
  122.    End
  123.    Begin Menu muMenu1 
  124.       Caption         =   "Menu 1"
  125.       Begin Menu muItem11 
  126.          Caption         =   "Item 1_1"
  127.       End
  128.       Begin Menu muItem12 
  129.          Caption         =   "Item 1_2"
  130.       End
  131.    End
  132.    Begin Menu muMenu2 
  133.       Caption         =   "Menu 2"
  134.    End
  135.    Begin Menu muWindow 
  136.       Caption         =   "Window"
  137.       WindowList      =   -1  'True
  138.       Begin Menu muWindowOpen 
  139.          Caption         =   "Open Child"
  140.       End
  141.       Begin Menu muWindowClose 
  142.          Caption         =   "Close Child"
  143.       End
  144.    End
  145. End
  146. Option Explicit
  147.  
  148. Sub MDIForm_Load ()
  149.     piStBar.Height = sbMain.Height
  150.     muMenu1.Tag = "Menu1.Tag"
  151.     muMenu2.Tag = "Menu2.Tag"
  152.     muItem11.Tag = "Item_1_1.Tag"
  153.     muItem12.Tag = "Item_1_2.Tag"
  154.     muWindow.Tag = "Open, Close, Select MDI child windows"
  155.     muWindowOpen.Tag = "Opens a new document window"
  156.     muWindowClose.Tag = "Close the active child"
  157. End Sub
  158.  
  159. Sub muWindow_Click ()
  160.     If Forms.Count > 1 Then
  161.     muWindowClose.Enabled = True
  162.     Else
  163.     muWindowClose.Enabled = False
  164.     End If
  165. End Sub
  166.  
  167. Sub muWindowClose_Click ()
  168.     Unload fmMain.ActiveForm
  169. End Sub
  170.  
  171. Sub muWindowOpen_Click ()
  172.     Dim fmNew As New fmChild
  173.     fmNew.Show
  174. End Sub
  175.  
  176. Sub sbMain_MenuSelect (Closing As Integer, MenuCaption As String)
  177.     If Closing <> 0 Then
  178.     Caption = "StBar Example  Main Form"
  179.     sbMain.Caption = ""
  180.     Else
  181.     Caption = "Menu Caption: " + MenuCaption
  182.     End If
  183. End Sub
  184.  
  185. Sub sbMain_SelectedTag (hWndForm As Integer, MenuTag As String)
  186.     Dim sText As String
  187.     Dim iChildMenu As Integer
  188.     
  189.     ' determine, if system menu of MDI child has been selected
  190.     If hWndForm = fmMain.hWnd Then
  191.     iChildMenu = False
  192.     Else
  193.     iChildMenu = True
  194.     End If
  195.  
  196.     Select Case MenuTag
  197.     Case "SYS_SIZE"
  198.         sText = "Changes the window size"
  199.     Case "SYS_MOVE"
  200.         sText = "Changes the window position"
  201.     Case "SYS_MINIMIZE"
  202.         sText = "Reduces the window to an icon"
  203.     Case "SYS_MAXIMIZE"
  204.         sText = "Enlarges the window to full size"
  205.     Case "SYS_RESTORE"
  206.         sText = "Restores the window to normal size"
  207.     Case "SYS_TASKLIST"
  208.         sText = "Opens the task list"
  209.     Case "SYS_NEXT"
  210.         sText = "Switches to next window"
  211.     Case "SYS_SWITCH"
  212.         sText = "Switches to the selected document window"
  213.     Case "SYS_POPUP"
  214.         If iChildMenu Then
  215.         sText = "Move, size or close active window"
  216.         Else
  217.         sText = "Move, size or close application window"
  218.         End If
  219.     Case "SYS_CLOSE"
  220.         If iChildMenu Then
  221.         sText = "Closes the active window"
  222.         Else
  223.         sText = "Quits VSQLTool"
  224.         End If
  225.     Case Else
  226.         sText = MenuTag
  227.     End Select
  228.  
  229.     sbMain.Caption = sText
  230. End Sub
  231.  
  232.